The technology described herein relates to graphics processing and in particular to the operation of a graphics processing system that performs a final gather process so as to generate final gather lighting data for a scene to be rendered.
It is common in graphics processing systems to render surfaces for display by sub-dividing each surface into a number of similar basic components called “primitives” to allow the graphics processing operations to be more easily carried out. These primitives are usually in the form of simple polygons, such as triangles. Each primitive is usually defined by and represented as a set of vertices. Each vertex for a primitive typically has associated with it a set of vertex attribute data (such as position, colour, transparency, texture coordinate, etc.) indicating the properties of the primitive at that vertex. This vertex attribute data may be used, for example, when rasterising and rendering the primitives in order to generate the desired output of the graphics processing system.
It is often desirable to apply lighting effects to enhance the atmosphere and/or realism of a scene that contains surfaces to be rendered. One common approach for applying lighting effects uses a “photon ray tracing” process to generate radiosity data for the surfaces within the scene (i.e. to generate data that represents the intensity of light transmitted through, emitted from, reflected by, etc., the surfaces within the scene). The photon ray tracing process typically comprises casting a plurality of photon rays from each light source that is being used to light the scene towards the surfaces within the scene. The radiosity at points on the surfaces that are intersected by the rays is calculated and the calculated radiosity is stored as radiosity data in a “light map” for the surfaces of the scene. The light map can then be used when rendering the surfaces of the scene. For example, the radiosity data in the light map may be used as a lighting texture when rendering the primitives that represent the surfaces of the scene.
When performing photon ray tracing, further “recursive” photon rays may be cast from surfaces within the scene towards other surfaces within the scene. This can provide indirect lighting effects that replicate first, and possibly subsequent, light bounces. This can improve the atmosphere and/or realism of the lighting effects. However, casting a sufficient number of recursive photon rays can be computationally expensive. On the other hand, casting no recursive photon rays or an insufficient number of recursive photon rays can lead to undesirably and/or unrealistically dull or dark areas in the scene.
To improve the atmosphere and/or realism of lighting effects, a “final gather” process may be carried out. The final gather process typically comprises casting a plurality of sampling rays in all directions away from “final gather points” for surfaces within the scene towards other surfaces and/or light sources for the scene. The sampling rays sample radiosity data for the other surfaces and/or light sources at the points at which those sampling rays meet the other surfaces and/or light sources. The sampled radiosity data for the final gather points is then combined to generate final gather lighting data for the scene. The final gather lighting data can then be used when rendering the scene. For example, the final gather lighting data may be used to create a lighting texture, which may then be used when rendering the primitives that represent the surfaces of the scene.
The direction in which the sampling rays are cast (i.e. away from the points for which lighting data is being generated) means that there is no need to cast recursive rays in order to create indirect lighting effects when performing the final gather process. Thus, the final gather process can lead to enhanced atmosphere and/or realism for the scene being lit whilst also being relatively less computationally expensive than equivalent photon ray tracing processes.
In order to be particularly effective, the final gather process usually still requires a large number of sampling rays to be cast in all directions from a large number of final gather points. This can place a large processing burden on the graphics processing system. It may of course be possible to reduce the number of sampling rays and/or final gather points so as to reduce the amount of processing needed, but this will inevitably reduce the quality of the final gather lighting data being generated.
The Applicants accordingly believe that there remains scope for improvements to the operation of graphics processing systems that perform a final gather process.
Like reference numerals are used for like components where appropriate in the drawings.